package edu.colorado.core;

import java.io.Serializable;

public class GameState implements Serializable
{
    private static final long serialVersionUID = 2800095220534642526L;
    
    Board board;
    Integer scoreArray[][];
    Integer score[];
    Integer winner;

    GameState(Board board)
    {
        this.board = board;

        winner = 2;

        scoreArray = new Integer[2][Algorithm.winPlaces];
        for (Integer i=0; i<Algorithm.winPlaces; i++)
        {
            scoreArray[0][i] = 1;
            scoreArray[1][i] = 1;
        }

        score = new Integer[2];
        score[0] = Algorithm.winPlaces;
        score[1] = Algorithm.winPlaces;
    }

    GameState(GameState otherState)
    {
        board = new Board(otherState.board);

        winner = otherState.winner;

        scoreArray = new Integer[2][Algorithm.winPlaces];
        for (Integer i=0; i<Algorithm.winPlaces; i++)
        {
            scoreArray[0][i] = otherState.scoreArray[0][i];
            scoreArray[1][i] = otherState.scoreArray[1][i];
        }

        score = new Integer[2];
        score[0] = otherState.score[0];
        score[1] = otherState.score[1];
    }
}

